package com.dwd.hrm.client;

import com.dwd.hrm.domain.LoginUser;
import com.dwd.hrm.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @Description: TODO
 * @Author 汶狄
 * @Date 2021/3/5 11:07
 * @Version 1.0
 */
@Component
public class LoginUserFallBackFactory implements FallbackFactory<LoginUserClient> {
    @Override
    public LoginUserClient create(Throwable throwable) {
        return new LoginUserClient() {
            @Override
            public AjaxResult addOrUpdate(LoginUser loginUser) {
                return new AjaxResult().setSuccess(false).setMessage("错误");
            }
        };
    }
}
